<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<title>用户添加页面</title>
<link href="<%=request.getContextPath()%>/css/Default.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/redmond/jquery-ui-1.8.14.custom.css"
	rel="stylesheet" type="text/css"></link>
<link href="<%=request.getContextPath()%>/css/Dialog.css"
	rel="stylesheet" type="text/css"></link>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="<%=request.getContextPath()%>/scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/scripts/HRM.js" type="text/javascript"></script>
<script
	src="<%=request.getContextPath()%>/scripts/jquery-ui-1.8.14.min.js"
	type="text/javascript"></script>
<script
	src="<%=request.getContextPath()%>/scripts/jquery.validate.min.js"
	type="text/javascript"></script>
<script
	src="<%=request.getContextPath()%>/scripts/jquery.validate.message_cn.js"
	type="text/javascript"></script>
<script
	src="<%=request.getContextPath()%>/scripts/Dialog.js"
	type="text/javascript"></script>
</head>
<body class="dialogBody">
<script type="text/javascript">
function beforeFormSubmitFunc(){
	var url=$("#configItemEditForm").attr('action');
	$("#configItemEditForm").attr('action',url);
	if(!$("#configItemEditForm").valid()){
		createAlertDialog('提示信息','还有未正确填写的项，请参照提示修改!');
		return false;
	}else{
		return true;
	}
}
$().ready(function(){
	$("#configItemEditForm").validate({
		rules:{
			configName:{
				required:true,
				maxlength:50
			},
			configCode:{
				required:true,
				maxlength:20
			},
			remark:{
				maxlength:200
			}
		},
		errorPlacement:function(error,element){
			createTooltip(error,element);
		},
		success:function(error,element){
			sucRemoveTooltip(error);
		},
		event:'blur'|'keyup'|'focus'|'keydown'
	});
	$('#configItemEditForm').find("input").focus(function(){
		$(this).valid();
	});
	$('#configItemEditForm').find("input").blur(function(){
		$('#'+$(this).attr('id')+'Error').remove();
	});
	//$('#configItemEditForm').find('#configItemName').focus();
});
</script>
<form id="configItemEditForm" action='<%=request.getContextPath()%>/config.do?method=updateConfigItemById' method="post">
<table width="430" height="227" align="center" cellpadding="2" cellspacing="0">
    <tr>
      <td height="10"></td>
      <td></td>
    </tr>
    <tr>
      <td>
   <fieldset>
    <legend><label>基本信息</label></legend>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="39%" height="30" align="right" >代码名称：<input name="id" type="hidden" value='<c:out value="${configItem.id}" />' id="id" /></td>
          <td width="61%"><input name="configName"  type="text" id="configName" value='<c:out value="${configItem.configName}" />' /><span class='requiredSpan'>*</span></td>
        </tr>
        <tr>
          <td height="30" align="right" >代码值：</td>
          <td><input name="configCode" type="text" id="configCode" value='<c:out value="${configItem.configCode}" />' /><span class='requiredSpan'>*</span></td>
        </tr>
        <tr id ="tr_ConfirmPassword2">
          <td height="30" align="right" >所属配置项：</td>
          <td><input type="text" disabled value='<c:out value="${configItem.configType}" />'/></td>
        </tr>
        <tr>
          <td height="30" align="right" >备注：</td>
          <td><textarea name="remark" id="remark" ><c:out value="${configItem.remark}" /></textarea></td>
        </tr>
      </table></fieldset></td>
    </tr>
	</table>
</form>

</body>
</html>